"use strict";
const BaseModel = require("../basics/mysql/mapper");
const webhook_url = "https://oapi.dingtalk.com/robot/send?access_token=1d4a3b344a07ef15cc0024c8586a699248e3266ebbbd68dff88a4fb61dee5160";
class HomeModel extends BaseModel {
  constructor(cloud) {
    super(cloud, "app_alarm");
  }

  /**
   * 获取实例
   * @param {*} cloud 
   */
  static getInstant(cloud) {
    return new HomeModel(cloud);
  }

  /**
   * 添加报警
   * @param {*} message 
   */
  async addOne(message) {
    const data = { message, phone_num: "", webhook_url, send_success: 0, is_at_all: 1 };
    return await this.insertOne(data);
  }
}

module.exports = HomeModel;